//
// Created by xili on 2024/8/13 17:11.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    int sumOfSquares(vector<int> &nums) {
        int n = nums.size();
        int ans = 0;
        for (int i = 0; i < n; i++) {
            ans += n % (i + 1) == 0 ? pow(nums[i], 2) : 0;
        }
        return ans;
    }
};